package com.app.utils;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;

import com.app.activity.ActivityCharge;

/**
 * Created by Administrator on 2017/2/16.
 */

public class DialogUtil {

    private static Dialog dialog;

    public static void showTipDialog(final Context context, String tip) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setPositiveButton("確定", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                Intent intent = new Intent(context, ActivityCharge.class);
                context.startActivity(intent);
                dialog.dismiss();
            }
        });
        builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
        builder.setTitle("提示");
        builder.setMessage(tip);
        builder.create().show();
    }

}
